package cn.sumpu.app.guoguojie.domain.Ext;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import cn.sumpu.app.guoguojie.constant.FamilyRole;
import cn.sumpu.app.guoguojie.domain.FamilyTag;
import cn.sumpu.app.guoguojie.util.Common;

public class FriendFamily implements Serializable {

	
	private static final long serialVersionUID = 4750227739664833992L;

	private Integer id;
//	好友家门牌号
	private String doorplate;
	private String nickname;
//	好友家头像
	private String avatar;
	private String member;
//	我家的门牌号
	private String family;
	private String group;
//	好友的家的门牌号，存在表示已经是好友
	private String friendId;
	private String groupName;
//	是否屏蔽好友动态
	private boolean shield;
	
	private List<FriendExt> fatherList;
	private List<FriendExt> motherList;
	private List<FriendExt> babyList;
	private List<FamilyTag> familyTagList;
	private List<FriendExt> friendList;
	
	public List<FamilyTag> getFamilyTagList() {
		return familyTagList;
	}
	public void setFamilyTagList(List<FamilyTag> familyTagList) {
		this.familyTagList = familyTagList;
	}
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public String getDoorplate() {
		return doorplate;
	}
	public void setDoorplate(String doorplate) {
		this.doorplate = doorplate;
	}
	public String getNickname() {
		return nickname;
	}
	public void setNickname(String nickname) {
		this.nickname = nickname;
	}
	public String getAvatar() {
		if(Common.empty(avatar)){
			avatar = Common.AVATAR_FAMILY_DEFALUT;
		}
		return avatar;
	}
	public void setAvatar(String avatar) {
		this.avatar = avatar;
	}
	public List<FriendExt> getFriendList() {
		return friendList;
	}
	public void setFriendList(List<FriendExt> friendList) {
		this.friendList = friendList;
	}
	public String getMember() {
		return member;
	}
	public void setMember(String member) {
		this.member = member;
	}
	public String getFamily() {
		return family;
	}
	public void setFamily(String family) {
		this.family = family;
	}
	public String getGroup() {
		return group;
	}
	public void setGroup(String group) {
		this.group = group;
	}
	public String getGroupName() {
		if(Common.empty(groupName)){
			groupName="我的朋友";
		}
		return groupName;
	}
	public void setGroupName(String groupName) {
		this.groupName = groupName;
	}
	public String getFriendId() {
		return friendId;
	}
	public void setFriendId(String friendId) {
		this.friendId = friendId;
	}
	public List<FriendExt> getFatherList() {
		if(fatherList!=null && fatherList.size()>0){
			return fatherList;
		}
		if(friendList!=null && friendList.size() > 0){
			for (FriendExt friend: friendList) {
				if(FamilyRole.FATHER.getValue().equals(friend.getRole())){
					if(fatherList == null){
						fatherList = new ArrayList<FriendExt>();
					}
					fatherList.add(friend);
				}
			}
		}
		return fatherList;
	}
	public void setFatherList(List<FriendExt> fatherList) {
		this.fatherList = fatherList;
	}
	public List<FriendExt> getMotherList() {
		if(motherList!=null && motherList.size()>0){
			return motherList;
		}
		if(friendList!=null && friendList.size() > 0){
			for (FriendExt friend: friendList) {
				if(FamilyRole.MOTHER.getValue().equals(friend.getRole())){
					if(motherList == null){
						motherList = new ArrayList<FriendExt>();
					}
					motherList.add(friend);
				}
			}
		}
		return motherList;
	}
	public void setMotherList(List<FriendExt> motherList) {
		
		this.motherList = motherList;
	}
	public List<FriendExt> getBabyList() {
		if(babyList!=null && babyList.size()>0){
			return babyList;
		}
		if(friendList!=null && friendList.size() > 0){
			for (FriendExt friend: friendList) {
				if(FamilyRole.BABY.getValue().equals(friend.getRole())){
					if(babyList == null){
						babyList = new ArrayList<FriendExt>();
					}
					babyList.add(friend);
				}
			}
		}
		return babyList;
	}
	public void setBabyList(List<FriendExt> babyList) {
		this.babyList = babyList;
	}
	public boolean isShield() {
		return shield;
	}
	public void setShield(boolean shield) {
		this.shield = shield;
	}
	
	
	
	
}
